const BaseHandler = require('../base-handler');
const SystemServices = require('../../../constants').SystemServices;
const HTTP_VERBS = require('../../../constants').HTTP_VERBS;

class DingstoreHandler extends BaseHandler {
    get pattern() {
        return "/admin/to/dingstore";
    }

    doGET(request, response) {
        if (request.session.user.authenticated) {
            const mapList = ['/admin/dingstore', '/admin/active']
            return response.render('dingstore', {
                user: request.session.user
            });
        } else {
            response.redirect('/login');
        }
    }

    setup() {
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
    }
}

module.exports = DingstoreHandler;